<script type="text/javascript">
    $(document).ready(loadCMSTable);
</script>
<div id="dt_example">
    <div id="container">
        <div id="demo"
             <div style="font-size: 15px;font-style: oblique;font-weight: bold;margin-bottom: 10px;"><?php echo $_REQUEST['module']?> Table</div>
             <div style="font-size: 15px;font-style: oblique;font-weight: bold;margin-bottom: 10px;margin: 20px;">
                 <a href ="#" onclick="load_link('index.php?page=lookups&action=create&module=<?php echo $_REQUEST['module']?>',load_validation)">Create <?php echo $_REQUEST['module']?></a>
             </div>
            <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
                <thead>
                    <tr>
                        <th>Name</th>
                        <th>Edit</th>
                        <th>Delete</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    foreach($lookups as $lookup){
                    echo"<tr>";
                        echo "<td>{$lookup->name}</td>";
                        echo "<td><a href ='#' onclick='load_link(\"index.php?page=lookups&action=create&id={$lookup->id}&module={$_REQUEST['module']}\",load_validation)'>Edit</a></td>";
                        $status = $lookup->isDeleted ==0?"Delete":"Restore";
                        $cstatus = $lookup->isDeleted ==1?"Deleted":"Active";
                        echo "<td>{$cstatus} ( <a href ='#' onclick='load_link(\"index.php?page=lookups&action=delete&id={$lookup->id}&module={$_REQUEST['module']}&delState={$lookup->isDeleted}\")'> {$status}</a> )</td>";
                    echo"</tr>";
                    }
                    ?>
                </tbody>
            </table>
        </div>
    </div>
</div>